import request from "/@/utils/request";
import download from "/@/utils/download.ts";

const TableApi = {

  showAllMappingInfo(data: any) {
    return request({
      url: "/demoApi/showAllMappingInfo",
      method: "post",
      data,
    });
  },

  permissionTypeList(data: any) {
    return request({
      url: "/demoApi/permissionTypeList",
      method: "post",
      data,
    });
  },
  getPageData(data: any) {
    return request({
      url: "/demoApi/pageData",
      method: "post",
      data,
    });
  },
  getDetail(data: any) {
    return request({
      url: "/demoApi/getDetail",
      method: "post",
      data,
    });
  },

  save: (data: any) => {
    return request({
      url: "/demoApi/save",
      method: "post",
      data,
    });
  },

  del: (data: any) => {
    return request({
      url: "/demoApi/del",
      method: "post",
      data,
    });
  },

  updateStatus: (data: any) => {
    return request({
      url: "/demoApi/updateStatus",
      method: "post",
      data,
    });
  },
  pageDataXls:(_searchParam: any,_xlsTitle: any,fileName?:string) => {
    return request({
      url: "/demoApi/pageDataXls",
      method: "post",
      responseType: 'blob',
      headersType: 'application/json;charset=UTF-8',
      data: {
        _searchParam,_xlsTitle
      },
  }).then((res)=> {
      download(res)
    });
},
};
export default TableApi;
